<?php
    $this->title = "Cadastro de projetos";
    $this->headTitle($this->title);
?>
<a class="linkBtn" href="<?php echo $this->url(array('module'=>'default','controller'=>'projetos','action'=>'add'));?>">Adicionar um novo projeto</a>
<table>
    <tr>
        <th>Projeto</th>
        <th>Responsável</th>
        <th class="center">Data Início</th>
        <th class="center">Data Estimada</th>
        <th style="width:60px;">&nbsp;</th>
    </tr>
<?php
    $cont = 0;
    foreach($this->projetos as $projeto) :
        $cont++;
        if($cont % 2 == 0)
            echo '<tr class="even">';
        else
            echo '<tr class="odd">';
?>
        <td class="texto"><?php echo $this->escape($projeto->projeto);?></td>
        <td class="texto"><?php echo $this->escape($projeto->responsavel);?></td>
        <td class="texto center"><?php echo $this->escape($this->formataData($projeto->dt_inicio));?></td>
        <td class="texto center"><?php echo $this->escape($this->formataData($projeto->dt_estimada));?></td>
        <td class="center">
        <a href="<?php echo $this->url(array('controller'=>'projetos','action'=>'edit', 'id'=>$projeto->id));?>">
        <img alt="Editar"  src="<?php echo $this->baseUrl().'/images/edit.png'; ?>"></a>
        <a href="<?php echo $this->url(array('controller'=>'projetos','action'=>'delete', 'id'=>$projeto->id));?>">
        <img alt="Apagar"  src="<?php echo $this->baseUrl().'/images/trash.png'; ?>"></a>
        </td>
<?php echo "</tr>"; endforeach; ?>
</table>
